//
//  IfengCycleScrollView.h
//  IfengNews
//
//  Created by 王 芬 on 14-7-2.
//
//

#import <UIKit/UIKit.h>

@protocol CycleScrollViewDelegate;
@protocol CycleScrollViewDatasource;

@interface IfengCycleScrollView : UIView<UIScrollViewDelegate>
{
  UIScrollView *_scrollView;
  
  NSInteger _totalPages;
  NSInteger _curPage;
  
  NSMutableArray *_curViews;
}

@property (nonatomic,readonly) UIScrollView *scrollView;
@property (nonatomic,assign) NSInteger currentPage;
@property (nonatomic,unsafe_unretained,setter = setDataource:) id<CycleScrollViewDatasource> datasource;
@property (nonatomic,unsafe_unretained,setter = setDelegate:) id<CycleScrollViewDelegate> delegate;
- (void)reloadData;
- (void)setViewContent:(UIView *)view atIndex:(NSInteger)index;

@end

@protocol CycleScrollViewDelegate <NSObject>

@optional
- (void)cSLoadDataAtIndex:(int)index;
@end

@protocol CycleScrollViewDatasource <NSObject>

@required
- (NSInteger)cSGetNumberOfPages;
- (UIView *)cSGetPageViewAtIndex:(NSInteger)index;

@end
